package com.zyy.iterator;

/**
 * @Description: 类描述
 * @Author: zyy
 * @Date: 2023/08/04 23:56
 */
public class Client {
    public static void main(String[] args) {
        StudentAggregate studentAggregate = new StudentAggregateImpl();

        studentAggregate.addStudent(new Student("1","张三"));
        studentAggregate.addStudent(new Student("2","李四"));
        studentAggregate.addStudent(new Student("3","王五"));
        studentAggregate.addStudent(new Student("4","赵六"));

        StudentIterator studentIterator = studentAggregate.getStudentIterator();
        while (studentIterator.hasNext()) {
            Student next = studentIterator.next();
            System.out.println(next);
        }
    }
}
